<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>图书管理系统</title>
    <link rel="stylesheet" href="/public/css/index.css">
</head>
<body>
    <div class="title">
        图书管理系统
        <a href="/add">添加图书</a>
    </div>
    <div class="content">
        <table>
            <thead>
                <tr>
                    <th>编号</th>
                    <th>名称</th>
                    <th>作者</th>
                    <th>分类</th>
                    <th>描述</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {{each list}}
                <tr>
                    <td>{{$index + 1}}</td>
                    <td>{{$value.name}}</td>
                    <td>{{$value.author}}</td>
                    <td>{{$value.fenlei}}</td>
                    <td>{{$value.desc}}</td>
                    <td>
                        <a href="/edit?id={{ $value._id }}">修改</a>|
                        <a href="/delete?id={{ $value._id }}">删除</a>
                    </td>
                </tr>
                {{/each}}
            </tbody>
        </table>
    </div>
</body>
</html>